<template>
  <div class="home">
    <Swiper :list="swiperList"/>
    <Header/>  
    <SwiperFoot/>  
    <Help/>
    <Product/>
  </div>
</template>

<script>
// @ is an alias to /src
import Header from '@/components/Home/head/Header.vue'
import Swiper from '@/components/Home/Swiper.vue'
import Help from '@/components/Help-entry.vue'
import SwiperFoot from '@/components/Home/Swiper-foot.vue'
import Product from '@/components/Home/Product.vue'
import axios from 'axios'
export default {
  name: 'home',
  components: {
    Header,
    Swiper,
    Help,
    SwiperFoot,
    Product
  },
  data () {
    return {
      swiperList: []
      }
    },
  methods: {
    // getHomeInfo () {
    //   axios.get('/mock/pc.json')
    //     .then(this.getHomeInfoSucc)
    // },
    getHomeInfoSucc (res) {
      res = res.data
      if (res.ret && res.data) {
        const data = res.data
        this.swiperList=data.swiperList
      }
    }
  },
  beforeRouteEnter (to, from, next) {
    axios.get('/mock/pc.json').then((res) => {
      next(vm => vm.getHomeInfoSucc(res))
    })
  }
}
</script>
<style lang="stylus">

</style>
